from django.db import models
from user_lib.models import CUser
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone

class ThreadCategory(models.Model):
    pass
    class Meta:
        verbose_name =_('Thread Category')
        verbose_name_plural = _('Thread Categories')
#----ABSTRACT BASE MODEL
class BaseThread(models.Model):
    author      = models.ForeignKey("user_lib.CUser")
    category    = models.ForeignKey(ThreadCategory)
    time_stamp  = models.DateTimeField(_('date published'),default=timezone.now)
    
    class Meta:
        abstract = True
    
class CodeStatusThread(BaseThread):
    level       = models.IntegerField()
    source      = models.CharField(_("source file:"),max_length=255)
    line        = models.IntegerField()
    comment     = models.TextField()
    status      = models.IntegerField()

class AssignmentThread(BaseThread):
    title       = models.CharField(_('title'),max_length=60)
    content     = models.TextField(_('content'))
    members     = models.TextField(_('invovled users'))
    
